#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>

int main()
{
  pid_t id=fork();
  if(id==0)
  {
    int cnt=500;
    while(cnt)
    {
      printf("I am child process,pid:%d,ppid:%d\n",getpid(),getppid());
      sleep(1);
      cnt--;
    }
    _exit(0);
  }
  else 
  {
    int cnt=5;
    while(cnt--)
    {
      
      printf("I am father process,pid:%d,ppid:%d\n",getpid(),getppid());
      sleep(1);
    }
  }
  return 0;
}
